<template>
  <el-dialog
    v-el-drag-dialog
    :title="$attrs['dialog-title']||'提示'"
    custom-class="custom-dialog"
    :visible.sync="dialogVisible"
    width="500px"
    :modal="false"
    :before-close="handleClose"
  >
    <slot />
  </el-dialog>
</template>

<script>
import elDragDialog from '@/directive/el-drag-dialog' // base on element-ui
export default {
  directives: { elDragDialog },
  model: {
    prop: 'dialogVisible',
    // 随便命名事件，对应下面$emit即可
    event: 'close'
  },
  props: {
    dialogVisible: {
      type: Boolean
    }
  },
  data() {
    return { myArray: [111, 222, 333] }
  },
  methods: {
    handleClose(done) {
      this.$emit('close', false)
    }
  }
}
</script>

<style></style>
